﻿// /////////////////////////////////// 
//  
//  
//      WiseLink CCF2.0 
//     (c)Copyright 2001-2010 WiseLink Xiaojun (David) Chen 
//        Authored and Owned Xiaojun (David) Chen 
//        All Right Reserved
//  
// /////////////////////////////////// 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using ZIC20Contract.DataType;


namespace ZIC20Contract.Service
{
    
    /// <summary>
    /// 所有ZIC的下发指令的返回值
    /// </summary>
    /// <summary>
    /// 0       --成功
    /// </summary>
    /// <summary>
    /// 10      --密码错误
    /// </summary>
    /// <summary>
    /// 102     --访问数据库错误
    /// </summary>
    /// <summary>
    /// 200     --连接中心失败，或者中心出现未知错误
    /// </summary>
    /// <summary>
    /// 1000    --数据库中没有’GPSADMIN’用户
    /// </summary>
    
    [ServiceContract(Name="WiseLinkZIC2.0",Namespace="http://www.WiseLink.com/ZIC/2011/12")]
    public interface IZIC20
    {
        /// <summary>
        /// 查看服务是否启动。 输入字符串返回 Response+字符串
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        [OperationContract]
        string HeartbeatCheck(string str);

        /// <summary>
        /// 从ZIS获取故障
        /// </summary>
        /// <param name="maxId">上次处理的最大ID</param>
        [OperationContract]
        void ProcessFaultInZIS(int maxId);

        /// <summary>
        /// 从ZIS获取撞车
        /// </summary>
        /// <param name="lastQueryTime">上次处理的时间</param>
        [OperationContract]
        void ProcessUrgentInZIS(DateTime lastQueryTime);

        /// <summary>
        /// 发送导航屏消息
        /// </summary>
        /// <param name="idc">IDC号</param>
        /// <param name="gprsType">消息类别</param>
        /// <param name="msg">消息</param>
        /// <returns></returns>
        [OperationContract]
        int SendGPRSMessage(string idc, GPRSMsgType gprsType, string msg);

        /// <summary>
        /// 发送POI信息到导航屏。
        /// </summary>
        /// <param name="idc">IDC号</param>
        /// <param name="msg">导航信息</param>
        /// <returns>参见interface IZIC20 里关于返回值的说明</returns>
        [OperationContract]
        int SendPOIMessage(string idc, POINavigation msg);

        /// <summary>
        /// 发送清码指令
        /// </summary>
        /// <param name="idc">IDC号</param>
        /// <param name="code">清码指令</param>
        /// <returns>参见interface IZIC20 里关于返回值的说明</returns>
        [OperationContract]
        int SendClearCodeMessage(string idc, ClearCodeType code);

        /// <summary>
        /// 发送系统升级指令
        /// </summary>
        /// <param name="idc">IDC号</param>
        /// <returns>参见interface IZIC20 里关于返回值的说明</returns>
        [OperationContract]
        int SendSystemUpgradeMessage(string idc);

        /// <summary>
        /// 发送设置车系指令
        /// </summary>
        /// <param name="idc">IDC号</param>
        /// <param name="code">车系代号</param>
        /// <returns>参见interface IZIC20 里关于返回值的说明</returns>
        [OperationContract]
        int SendVehicleBrandCodeMessage(string idc, VehicleBrandCode code);


        /// <summary>
        /// 获取最近一次位置信息
        /// </summary>
        /// <param name="idc">IDC号</param>
        /// <returns>GPSPositionInfo</returns>
        [OperationContract]
        GPSPositionInfo GetLastKnownPosition(string idc);


        /// <summary>
        /// 获取轨迹回放
        /// </summary>
        /// <param name="idc">IDC号</param>
        /// <param name="startTime">轨迹回放开始时间</param>
        /// <param name="endTime">轨迹回放结束时间</param>
        /// <returns>GPSPositionInfo</returns>
        [OperationContract]
        IEnumerable<GPSPositionInfo> GpsPositionTrace(string idc, DateTime startTime, DateTime endTime);



        [OperationContract]
        bool RegisterDevice(string idc);


        [OperationContract]
        bool QueryFaultInfo(string code, VehicleBrandCode brand);
    }
}
